package main

import (
	"context"
	"github.com/1141520944/go-library/hjz/common"
	sProxy "github.com/1141520944/go-library/hjz/proxy/server"
	"github.com/1141520944/go-library/hjz/websocket"
	"github.com/1141520944/go-library/library/log"
	"github.com/gin-gonic/gin"
	"net/http"
)

var l *log.Logger

func main() {
	ctx, cancel := context.WithCancel(context.Background())
	l = common.LoggerDefault("proxy_server.log", "./tqLogger/server")
	websocket.DefaultWebsocket()
	sProxy.DefaultServe(ctx, websocket.GetWebServer(), l)
	common.AddRouter(sProxy.NewSHandler())
	e := gin.Default()
	r := common.InitRouter(e, l)
	common.Run(l, &http.Server{Handler: r, Addr: "0.0.0.0:9999"}, cancel)
}
